package org.example.service.impl;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.example.domain.Person;
import org.example.service.TestService;
import org.example.utils.JsonResult;
import org.springframework.lang.Nullable;
import org.springframework.stereotype.Service;

/**
 * @Author: WangShengJie
 * @Date: 2025/4/21
 */
@Service
@Slf4j
public class TestServiceImpl implements TestService {

    /**
     * 测试方法监听器的Controller
     * @param person person
     * @return JsonResult
     */
    @Override
    public JsonResult methodListenerTest(Person person) {
        System.out.println("调用了TestServiceImpl中的methodListenerTest() 方法");
        return JsonResult.buildSuccess("操作成功！");
    }

    @Override
    @Nullable
    public String nullDemo(@Nullable String name) {
        if (StringUtils.isBlank(name)) {
            return "1232";
        }
        return null;
    }
}
